﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Demo
{
  class Program
  {
    static void Main(string[] args)
    {
      string connStr, dataProvider = null;
      // Sample How to read DB schema
      // !!!!!!!!!! Modify connection string for Microsoft SQL Database Nortwind
      dataProvider = "System.Data.SqlClient";
      connStr = @"Data Source=.\SQLEXPRESS;AttachDbFilename=l:\test\northwnd.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";

      var dbp = new ma.DbSchemaProvider.DbSchemaProvider(dataProvider, connStr);
      var tabDef = dbp.GetTable("Products");
      var colDef = dbp.GetColumns("Products");
      var keyDef = dbp.GetPrimaryKeys("Products");


      // !!!!!!!!!! Modify connection string for Oracle DB
      dataProvider = "Devart.Data.Oracle";
      connStr = @"User Id=HR; Password=hr; Data Source=127.0.0.1:1521/XE";
      dbp = new ma.DbSchemaProvider.DbSchemaProvider(dataProvider, connStr);
      tabDef = dbp.GetTable("JOBS");
      colDef = dbp.GetColumns("JOBS");
      keyDef = dbp.GetPrimaryKeys("JOBS");
    }
  }
}
